package com.spring.demo2.eg3;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author vhans
 */
public class Test {
    @org.junit.Test
    public void test() {
        // user1的name为空
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MainConfig.class);
        context.getBeansOfType(User.class).forEach((name, bean) -> {
            System.out.println(name + "->" + bean);
        });
    }
}
